<%@ include file="/WEB-INF/views/includes.jsp" %>
<%@ include file="/WEB-INF/views/header.jsp" %>
<%@ page session="false" %>

<table style="width:100%;">
	<tr>
		<td>
			<h1>Administration</h1>
		</td>
		<td style="text-align:right;" align="right">
			<a class="operation-link icon-link" href="<c:url value='/user/add'/>"><img style="margin-right:3px;vertical-align:text-top;" src="<c:url value='/resources/images/user_add.png' />" />Add User</a>
		</td>	
	</tr>
</table>


<%-- USERS TABLE --%>
<table class="bluetable" style="width:100%;" cellspacing="1">
	<tr>
		<th style="width:100px;">University ID</th>
		<th style="width:250px;">Name</th>
		<th>Roles</th>
		<th style="width:40px;">&nbsp;</th>
	</tr>
	<c:forEach var="user" items="${users}">
	<tr>
		<td>${user.username}</td>
		<td>${user.name}</td>
		<td>
			<c:forEach var="authority" items="${user.authorities}" varStatus="status">
				${authority}${not status.last ? ',' : ''}
			</c:forEach>
		</td>
		<td align="center">
			<a title="Edit ${user.username}" class="icon-link" href="<c:url value='/user/${user.id}'/>"><img src="<c:url value='/resources/images/user_edit.png'/>" /></a>
			<a title="Delete ${user.username}" class="icon-link" href="<c:url value='/admin/deleteUser?uid=${user.id}'/>"><img src="<c:url value='/resources/images/user_delete.png'/>" /></a>
		</td>
	</tr>
	</c:forEach>
</table>

<%@ include file="/WEB-INF/views/footer.jsp" %>